package com.xhdx.classloader;

public class Test1 {
    public static void main(String[] args) throws Exception {

        CustomClassLoader loader = new CustomClassLoader("");
        loader.setBasPath("D:\\work\\workspace1\\TestProject\\des\\");//指定自定义类加载器加载路径
        Class<?> clazz = loader.loadClass("Car"); //指定加载Car类
        System.out.println(clazz.getClassLoader());//输出加载类Car的加载器
        Object object = clazz.newInstance();//创建Car类对象，会调用构造方法
    }
}
